<?php
//include_once "../qc_base.php";
//include_once "../qc_utils.php";
//include_once "../bootstrap.php";
//include_once "../lib/phpctls/PhpCtls.php";


	$q = Doctrine_Query::create()
	->from('Crudcols cc')
	->leftJoin('cc.VarInfo v')
	->Where('crudset_id = ?',$crudset_id);
	
	//echo $q->getSqlQuery();
	//exit;
	
	$ar_crudcols = $q->execute()->toArray(true);	

	
	$ar_selections = array(array('showvalue'=>'Select Column','keyvalue'=>''));
	//echo "<pre>";
	//print_r($ar_crudcols);
	//echo "</pre>";
	
	foreach($ar_crudcols AS $ar_crudcol){
		$ar_selection['showvalue'] = $ar_crudcol['VarInfo']['variable_name'];
		$ar_selection['keyvalue'] = $ar_crudcol['crudcol_id'];
		$ar_selections[] = $ar_selection;
	}
	
	
$ctl_SelectCrudcol = new CtlSelect(array('name'=>'crudcol_id', 'id'=>'crudcol_id', 'set_on_change'=>'this.form.submit()'),
$crudcol_id, $ar_selections);
print $ctl_SelectCrudcol->render();	
if(!empty($arParameters['crudcol_id'])){
	$arSubMenu = sort($arParameters['crudcol_id']);
	foreach($arParameters['crudcol_id'] as $link){
		print $link;
	}
}	

		print "<li><a href='filters/filters_ctl.php?crudset_id=$crudset_id&crudcol_id=$crudcol_id' target='mainframe'>View Filters</a></li>";

?>